POV-Ray : Newsgroups : povray.general : Github repository with useful macros : Re: Github repository with useful macros Server Time
4 May 2024 11:30:12 EDT (-0400)
  Re: Github repository with useful macros  
From: Bald Eagle
Date: 22 May 2021 20:05:00
Message: <web.60a99b83985098ff1f9dae3025979125@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:

> Btw.: The Official Windows POV-Ray v3.7 says that 1e16 + 1 = 1e16.
>
> Therefore I tested the macros I just posted with the scalar value 1e17, and they
> both think that it is a 2D vector.

That's crazy.

There are MORE joys of floating point math?  ;)


with qtpovray on Linux Mint, I get
1e15 + 1 = ScalarValue = 1000000000000001.000
1e15+1.1 = ScalarValue = 1000000000000001.125
1e16 + 1 = ScalarValue = 10000000000000000.000
1e16 +1.1 = 2D2D VECTOR = <10000000000000002.000, 0.000>
1e16 + 10 = 2D2D VECTOR = <10000000000000010.000, 0.000>
1e17 = 2D VECTOR = <100000000000000000.000, 0.000>

> So these solutions are not numerical robust.

Nope.   But for smaller numbers and general usage they're better than what we
had.

> Perhaps we need an istype() function like jr suggested.

It would be great, especially since then we could type thing in CSV files as
they're being read in, and would need foreknowledge of the file structure.

Alternatively, we could use a trap() or OnError () function that allows
sequential rejection of blocks of code that would try to operate on the wrong
type until the code encountered a test that didn't throw an error.


Post a reply to this message

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