C# - Math ScaleB() Method
The C# Math ScaleB() method returns a x 2b.
Syntax
public static double ScaleB (double a, int b);
Parameters
a |
Specify value to be scaled by power of 2. |
b |
Specify power of 2 used to scale a. |
Return Value
Returns a x 2b.
Example:
In the below example, ScaleB() method returns a x 2b.
using System; class MyProgram { static void Main(string[] args) { Console.WriteLine(Math.ScaleB(2.55, 4)); Console.WriteLine(Math.ScaleB(10, 3)); } }
The output of the above code will be:
40.8 80
❮ C# Math Methods