RosettaCodeData/Task/Gray-code/F-Sharp/gray-code-1.fs

3 lines
179 B
Forth
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
// Functıons to translate bınary to grey code and vv. Nigel Galloway: December 7th., 2018
let grayCode,invGrayCode=let fN g (n:uint8)=n^^^(n>>>g) in ((fN 1),(fN 1>>fN 2>>fN 4))