int nan
bearophile
bearophileHUGS at lycos.com
Mon Jun 29 05:01:53 PDT 2009
Frits van Bommel:
> It's fine for Lisp because any Lisp I've ever seen auto-upgrades out-of-range
> integers to (heap-allocated) bigints.
I think it can be fine even if you have just fixnums with that single value missing from signed integrals.
> I'd like to point out you don't need a new built-in type (or changes to a
> existing one) to use those LLVM intrinsics with LDC. Just import ldc.intrinsics,
> define a struct MyInt and overload operators on it using llvm_sadd_with_overflow
> and friends.
>
> That doesn't work for external libraries of course, but those should be free to
> handle overflow situations and undefined operations however they want without
> having to worry about int.nan...
Probably I have not expressed myself well in this part of my post, because here I was not taking about a new int type or about int nans.
I was talking about int overflows. I'll explain better in #ldc.
Bye,
bearophile
More information about the Digitalmars-d
mailing list