Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

c#
scaleb
math
communitycreator

What is Math.ScaleB() in C#?

Arslan Bajwa

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Answers Code

C# has a built-in Math class which provides useful mathematical functions and operations. The class has the ScaleB() function, which is used to compute _base * (2 ^ _power).

Syntax

public static double ScaleB (double _base, int _power);

Parameters

  • _base: This is a double-precision floating-point number that specifies the base value for finding ScaleB().
  • _power: This is a 32-bit integer that specifies the power for finding ScaleB().

Return value

  • Double: This value returns a Double number found by computing _base * (2 ^ _power).

Example

using System;
class Educative
{
static void Main()
{
double result = Math.ScaleB(3, 2);
System.Console.WriteLine("ScaleB(3, 2) = "+ result);
double result1 = Math.ScaleB(2.55, 4);
System.Console.WriteLine("ScaleB(2.55, 4) = "+ result1);
}
}

Output

  • ScaleB ( 3 , 2 ) = 12
  • ScaleB ( 2.55 , 4 ) = 40.8

RELATED TAGS

c#
scaleb
math
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Answers Code
Keep Exploring