BigInteger.Log 메서드

정의

지정된 숫자의 로그를 반환합니다.

오버로드

Name Description
Log(BigInteger)

지정된 숫자의 자연(기본 e) 로그를 반환합니다.

Log(BigInteger, Double)

지정된 기준에서 지정된 숫자의 로그를 반환합니다.

Log(BigInteger)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

지정된 숫자의 자연(기본 e) 로그를 반환합니다.

public:
 static double Log(System::Numerics::BigInteger value);
public static double Log(System.Numerics.BigInteger value);
static member Log : System.Numerics.BigInteger -> double
Public Shared Function Log (value As BigInteger) As Double

매개 변수

value
BigInteger

로그를 찾을 수 있는 숫자입니다.

반품

주의 섹션의 e표에 표시된 것처럼 자연(기본value) 로그입니다.

예외

기본 로그 value 가 데이터 형식 범위를 벗어났습니다 Double .

설명

value 매개 변수는 기본 10 숫자로 지정됩니다.

이 메서드의 정확한 반환 값은 다음 표와 같이 부 value호에 따라 달라집니다.

매개 변수의 value 기호 반환 값
양수 즉, ln value또는 log evaluevalue자연 로그입니다.
0(Zero) NegativeInfinity;
음수 NaN;

값의 base 10 로그를 BigInteger 계산하려면 메서드를 호출합니다 Log10 . 다른 밑의 숫자 로그를 계산하려면 메서드를 호출합니다 Log(BigInteger, Double) .

메서드와 함께 메서드를 호출 Log 하여 숫자의 제곱근을 Math.Exp 찾을 수 있습니다. 결과는 Double.PositiveInfinity .보다 Double.MaxValue큰 경우입니다. 다음 예제에서는 값 배열 BigInteger 에서 각 요소의 제곱근을 계산합니다.

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      BigInteger[] values = { 2, 100, BigInteger.Pow(1000, 100), 
                              BigInteger.Pow(2, 64) };
      foreach (var value in values)                                    
         Console.WriteLine("The square root of {0} is {1}", value, 
                           Math.Exp(BigInteger.Log(value) / 2));
   }
}
// The example displays the following output:
//    The square root of 2 is 1.41421356237309
//    The square root of 100 is 10
//    The square root of 1000000000000000000000000000000000000000000000000000000000000
//    00000000000000000000000000000000000000000000000000000000000000000000000000000000
//    00000000000000000000000000000000000000000000000000000000000000000000000000000000
//    00000000000000000000000000000000000000000000000000000000000000000000000000000000
//     is 9.99999999999988E+149
//    The square root of 18446744073709551616 is 4294967296
open System
open System.Numerics

let values = [| 2I; 100I; BigInteger.Pow(1000I, 100); BigInteger.Pow(2I, 64) |]

for value in values do
    printfn $"The square root of {value} is {Math.Exp(BigInteger.Log(value) / 2.)}"
// The example displays the following output:
//    The square root of 2 is 1.41421356237309
//    The square root of 100 is 10
//    The square root of 1000000000000000000000000000000000000000000000000000000000000
//    00000000000000000000000000000000000000000000000000000000000000000000000000000000
//    00000000000000000000000000000000000000000000000000000000000000000000000000000000
//    00000000000000000000000000000000000000000000000000000000000000000000000000000000
//     is 9.99999999999988E+149
//    The square root of 18446744073709551616 is 4294967296
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim values() As BigInteger = { 2, 100, BigInteger.Pow(1000, 100), 
                                     BigInteger.Pow(2, 64) }
      For Each value In values                                    
         Console.WriteLine("The square root of {0} is {1}", value, 
                           Math.Exp(BigInteger.Log(value) / 2))
      Next                                     
   End Sub
End Module
' The example displays the following output:
'    The square root of 2 is 1.41421356237309
'    The square root of 100 is 10
'    The square root of 1000000000000000000000000000000000000000000000000000000000000
'    00000000000000000000000000000000000000000000000000000000000000000000000000000000
'    00000000000000000000000000000000000000000000000000000000000000000000000000000000
'    00000000000000000000000000000000000000000000000000000000000000000000000000000000
'     is 9.99999999999988E+149
'    The square root of 18446744073709551616 is 4294967296

이 메서드는 Math.Log(Double) 기본 숫자 형식의 메서드에 해당합니다.

추가 정보

적용 대상

Log(BigInteger, Double)

Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs
Source:
BigInteger.cs

지정된 기준에서 지정된 숫자의 로그를 반환합니다.

public:
 static double Log(System::Numerics::BigInteger value, double baseValue);
public static double Log(System.Numerics.BigInteger value, double baseValue);
static member Log : System.Numerics.BigInteger * double -> double
Public Shared Function Log (value As BigInteger, baseValue As Double) As Double

매개 변수

value
BigInteger

로그를 찾을 수 있는 숫자입니다.

baseValue
Double

로그의 기준입니다.

반품

baseValue 주의 섹션의 value표에 표시된 대로 기본 로그입니다.

예외

로그 value 가 데이터 형식 범위를 벗어났습니다 Double .

설명

value 매개 변수는 baseValue 기본 10 숫자로 지정됩니다.

메서드의 정확한 반환 값은 다음 표와 같이 부호 value 와 부호 및 값 baseValue에 따라 달라집니다.

value 매개 변수 baseValue 매개 변수 반환 값
value > 0 (0 <baseValue< 1) -or-(baseValue> 1) logbaseValue(value)
value < 0 (모든 값) Double.NaN
(모든 값) baseValue < 0 Double.NaN
value != 1 baseValue = 0 Double.NaN
value != 1 baseValue = Double.PositiveInfinity Double.NaN
(모든 값) baseValue = Double.NaN Double.NaN
(모든 값) baseValue = 1 Double.NaN
value = 0 0 <baseValue< 1 Double.PositiveInfinity
value = 0 baseValue > 1 Double.PositiveInfinity
value = 1 baseValue = 0 0
value = 1 baseValue = Double.PositiveInfinity 0

값의 base 10 로그를 BigInteger 계산하려면 메서드를 호출합니다 Log10 . 숫자의 자연 로그를 계산하려면 메서드를 호출합니다 Log(BigInteger) .

이 메서드는 Math.Log 기본 숫자 형식의 메서드에 해당합니다.

추가 정보

적용 대상