POV-Ray : Newsgroups : povray.newusers : scientific notation : Re: scientific notation Server Time
3 Oct 2025 04:21:33 EDT (-0400)
  Re: scientific notation  
From: Bald Eagle
Date: 23 Sep 2025 14:00:00
Message: <web.68d2def3f4db7ec91398638025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> Yes, it works and is quite elegant, although it's a bit beyond my mental grasp
> as to how. I haven't used logarithms since my college days, ha.

log(N) = 10^exponent

which gives you some (usually) non-integer exponent.
But you only want the integer part of that.

then you raise 10 to that power, and divide your original number by that.
That obviously gives you the number to multiply that power of 10 by.
Then you just cobble it all together with concat.

> Although: For fractional values like .000794, it returns 0.794e-3. Shouldn't it
> return 7.94e-4 instead?

I don't have my laptop at hand because "reasons" - so I'm just doing this in
Excel.

Excel has a weird Floor format, so I used Int.

Try using floor().  Or ceil.  Or maybe POV-Ray does weird things and you need to
test your value and then conditionally use one or the other.

I would love an online parser.  :)

- bw


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.