|
|
On 6/24/24 20:30, William F Pokorny wrote:
> #declare Val = 1.012345678901234567890/(+0.0); // +inf Why + ?
Should have read:
#declare Val = 1.012345678901234567890/(-0.0); // +inf Why + ?
---
FWIW. This morning I glanced at the str() implementation while my coffee
maker worked. You can on overflowing an internal buffer, trigger
exponential (%g) formatting, but that method is of course not of
practical use...
---
I also forgot, as I often do because of its name, about our val() SDL
function which converts string floating point representations of values
to internal double representations. The following works, which could be
useful for +-inf maths.
#debug concat("val(\"+inf\") = ",str(val("+inf"),19,17),"\n")
#debug concat("val(\"-inf\") = ",str(val("-inf"),19,17),"\n")
#debug concat("val(\"+nan\") = ",str(val("+nan"),19,17),"\n")
#debug concat("val(\"-nan\") = ",str(val("-nan"),19,17),"\n")
---
Aside. I've have avoided putting much work into the SDL string functions
in yuqk because I want to do that work alongside a move to all utf8
string handling (with conversions to ucs4 internally for things like
strlen(), maybe message passing too, I don't know - all at that dream
planning stage).
Bill P.
Post a reply to this message
|
|