def Digit.is_odd

bend-trace-context@0.2.0.0 · src/hex.bend:142

import bend-trace-context@0.2.0.0/src/hex.bend as Hex
import Base

142# Whether bit 0 (value 1) of the digit is set. In the last digit of the flags
143# this is the sampled flag (W3C 3.2.2.5.1).
144def Digit.is_odd(digit: Digit) -> Bool:
145  match digit:
146    case H0{}:
147      False{}
148    case H1{}:
149      True{}
150    case H2{}:
151      False{}
152    case H3{}:
153      True{}
154    case H4{}:
155      False{}
156    case H5{}:
157      True{}
158    case H6{}:
159      False{}
160    case H7{}:
161      True{}
162    case H8{}:
163      False{}
164    case H9{}:
165      True{}
166    case Ha{}:
167      False{}
168    case Hb{}:
169      True{}
170    case Hc{}:
171      False{}
172    case Hd{}:
173      True{}
174    case He{}:
175      False{}
176    case Hf{}:
177      True{}

Uses (2)

Used by (4)