You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if anyone encountered this before (I've searched from the issue)
//
fatal error: Double value cannot be converted to Int because it is either infinite or NaN
(lldb)
//
I got this error message when I'm entering a screen to display the chart.
// here's your method
internal class func decimals(_ number: Double) -> Int
{
if number.isNaN || number.isInfinite || number == 0.0
{
return 0
}
let i = roundToNextSignificant(number: Double(number))
if i.isInfinite
{
return 0
}
return Int(ceil(-log10(i))) + 2
}
//
return Int(ceil(-log10(i))) + 2 // <------------------------
Unable to convert the return value to int, so I tried using Int(round(ceil(-log10(i))) + 2), gives the same error. Could it be something wrong with the calculations inside?
Please advice.
Thank you!
The text was updated successfully, but these errors were encountered:
Hello,
Not sure if anyone encountered this before (I've searched from the issue)
//
fatal error: Double value cannot be converted to Int because it is either infinite or NaN
(lldb)
//
I got this error message when I'm entering a screen to display the chart.
// here's your method
internal class func decimals(_ number: Double) -> Int
{
if number.isNaN || number.isInfinite || number == 0.0
{
return 0
}
//
return Int(ceil(-log10(i))) + 2 // <------------------------
Unable to convert the return value to int, so I tried using Int(round(ceil(-log10(i))) + 2), gives the same error. Could it be something wrong with the calculations inside?
Please advice.
Thank you!
The text was updated successfully, but these errors were encountered: