[quickjs-devel] toString radix is ignored for float numbers

  • From: Yifeng Wang <doodlewind@xxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Wed, 29 Jul 2020 12:31:00 +0800

Hi,

We found that for numbers, QuickJS can only use decimal radix in
`toString`, if the number is not an integer.

With qjs:

(10.0).toString(16) // "a"
(10.1).toString(16) // "10.1"

With V8:

(10.0).toString(16) // 'a'
(10.1).toString(16) // 'a.1999999999998'

Wondering what's the expected semantics in this case. Thanks.

Regards
Yifeng Wang

Other related posts:

  • » [quickjs-devel] toString radix is ignored for float numbers - Yifeng Wang