[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.format(""%x",5.5)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 1 Dec 2011 19:13:59 -0200
> > The Lua 5.2 change document makes a suggestion that Lua 5.2 has "support for hexadecimal floats."
> >
> > local ok, v = pcall(string.format," --[[ 0x%x ]]",5.5)
>
> Try %a instead of 0x%x. Try also
>
> a=0x1.6p+2 ; print(a)
As a side note, rc4 changed back this error, so %x accepts 5.5 as
argument (behaving as 5.1 did). Note that %x (and %d, etc.) still
complain if the number is out of range.
-- Roberto