Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with NAN
#1
My memory is sharp but short. Where a same number is divided by itself the resultant is 1 ( ie 1/1 , 2/2 etc) in keeping with this I'm trying to catch a NAN result and convert it to the value of 1. So NAN doesn't seem to be a numeric nor a string. Is there a way to trap NAN and force a value of 1 ??

Code: (Select All)
a = 0
b = 0
Print
Print
Print " Where a = 0 and b = 0"
Print " a/b = "; a / b
Print " b/a = "; b / a
Result$ = Str$(a / b)

If a / b = nan Or b / a = nan Then
    a = 1
    b = 1
    Print "New Value of a/b = "; a / b
End If

If Result$ = "NAN" Or Result$ = "nan" Then
    a = 1
    b = 1
    Print "New Value of a/b = "; a / b
End If
Reply


Messages In This Thread
Working with NAN - by Dimster - 09-08-2023, 03:45 PM
RE: Working with NAN - by DSMan195276 - 09-08-2023, 03:57 PM
RE: Working with NAN - by mnrvovrfc - 09-08-2023, 04:03 PM
RE: Working with NAN - by Dimster - 09-08-2023, 06:06 PM
RE: Working with NAN - by mnrvovrfc - 09-08-2023, 06:22 PM
RE: Working with NAN - by DSMan195276 - 09-08-2023, 07:43 PM
RE: Working with NAN - by Dimster - 09-09-2023, 01:42 PM
RE: Working with NAN - by DSMan195276 - 09-09-2023, 02:31 PM
RE: Working with NAN - by Dimster - 09-09-2023, 03:48 PM
RE: Working with NAN - by SMcNeill - 09-09-2023, 05:03 PM
RE: Working with NAN - by Dimster - 09-09-2023, 06:48 PM
RE: Working with NAN - by SMcNeill - 09-09-2023, 07:11 PM
RE: Working with NAN - by SMcNeill - 09-09-2023, 07:26 PM
RE: Working with NAN - by SMcNeill - 09-09-2023, 08:15 PM
RE: Working with NAN - by grymmjack - 09-10-2023, 12:24 AM
RE: Working with NAN - by eoredson - 09-15-2023, 03:03 AM



Users browsing this thread: 3 Guest(s)