Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

88
Views
JavaScript SpeechSynthesisUtterance

Why does the SpeechSynthesisUtterance.volume property return "0.4000000059604645" when set to ".4"?

var u = new SpeechSynthesisUtterance();
u.volume = .4;
console.log(u.volume);

var u = new SpeechSynthesisUtterance();
u.volume = .4;
console.log(u.volume);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The .volume property is specified to be stored as a "float", which means that it's stored per single-precision 32 bit IEEE 754.

If you plug in 0.4, you get the hex value of 0x3ecccccd, which, when converted back to decimal, is 0.4000000059604645 (due to imprecision).

This is in contrast to normal JavaScript numbers, in which are stored as double-precision 64-bit numbers (and thus have many more accurate trailing digits).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!