Hi Carl
> >yeah, REBOLs build-in binary capabilities are a bit strange sometimes :-/
> >## to binary! 100
> >== #{313030}
>
> Doesn't that seem like a bug?
>
Yes, now that you mention it, this has bothered me all along. It is often
frustrating that to-binary returns the ascii bytes of the string
representation of integers and decimals. It would be useful and logical if
to-binary actually returned the IEEE754 representations for integer and
decimal arguments. This would be very helpful for those few of us who are
interested in using REBOL for engineering and scientific numeric work.
Possibly things are the way they are because the binary type is an
any-string. I guess the internal representation for the data of a binary is
just the same sequence of bytes as a string. Consider
>> to-string to-binary 100
== "100"
>> to-binary 100
== #{313030}
>> to-binary to-string #{313030}
== #{313030}
>> to-string #{313030}
== "100"
In other words, to-binary and to-string are mutually inverse operations.
They just show different ways of looking at the same underlying byte
sequence.
Cheers
-Larry