How to construct a 64-bit floating-point value from the mantissa m, exponent e, and sign flag s in VB.NET

1 Answer

0 votes
Imports System

Class Program
    Public Shared Sub Main()
        ' Mantissa — the core number to be scaled.
		Dim m As Double = 5.1
		' exponent
        Dim e As Integer = 10
		' Sign flag: false means positive.
        Dim s As Boolean = False
		
        Dim value As Double = (If(s, -1.0, 1.0)) * m * Math.Pow(10, e)
        
		Console.WriteLine(value)
    End Sub
End Class



' run:
'
' 51000000000
'

 



answered Jul 14, 2025 by avibootz
...