Drawing a logarithmic histogram

A

Andre

Hi,

I'm trying to plot a histogram on some data that I receive at runtime.
I'm trying to measure distances between two points, and these distances
can be from the range 1 to 5000000. I want to use a logarithmic scale
with a range -2^29 to +2^29. How can I determine at any point in time
which strata (i.e which cohort or portion of scale) the value belongs to
(without using the square or square-root functions)?

I could have mask-bits of all possible scales, such as 2^2, 2^3, 2^4
upto 2^29 and AND each of these with the value to figure this out but is
there a cleaner way of doing this?

Thanks a lot.

--Andre
 
G

Glen Herrmannsfeldt

I'm trying to plot a histogram on some data that I receive at runtime.
I'm trying to measure distances between two points, and these distances
can be from the range 1 to 5000000. I want to use a logarithmic scale
with a range -2^29 to +2^29. How can I determine at any point in time
which strata (i.e which cohort or portion of scale) the value belongs to
(without using the square or square-root functions)?

Log graphs will not have negative numbers in the range ( or is it domain?).

Maybe you meant 2**(-29). (Note that the ^ operator has a different meaning
in C.)

I would think that log() would be useful. If more than one dimension, you
would also want sqrt().

-- glen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top