github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/math/big/floatmarsh.go (about)

     1  // Copyright 2015 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // This file implements encoding/decoding of Floats.
     6  
     7  package big
     8  
     9  // GobEncodeは、[encoding/gob.GobEncoder] インターフェースを実装します。
    10  // [Float] の値とそのすべての属性(精度、丸めモード、精度)がマーシャルされます。
    11  func (x *Float) GobEncode() ([]byte, error)
    12  
    13  // GobDecodeは、[encoding/gob.GobDecoder] インターフェースを実装します。
    14  // 結果は、zの精度と丸めモードに従って丸められます。
    15  // ただし、zの精度が0の場合、zは正確にデコードされた値に設定されます。
    16  func (z *Float) GobDecode(buf []byte) error
    17  
    18  // MarshalTextは、[encoding.TextMarshaler] インターフェースを実装します。
    19  // [Float] の値のみが(全精度で)マーシャルされ、精度や精度などの他の属性は無視されます。
    20  func (x *Float) MarshalText() (text []byte, err error)
    21  
    22  // UnmarshalTextは、[encoding.TextUnmarshaler] インターフェースを実装します。
    23  // 結果は、zの精度と丸めモードに従って丸められます。
    24  // ただし、zの精度が0の場合、丸めが効く前に64に変更されます。
    25  func (z *Float) UnmarshalText(text []byte) error