2023-09-01 Code Roundup
Random question from LinkedIn prompted a bit of a code adventure this morning. See some work in both Ruby and F# to answer it.
![2023-09-01 Code Roundup](https://cdn.danielbmarkham.com/2023/09/2023-08-29_base20FloatingPointNumberConversionQuestion.png)
Join the Nerd Roundup Discord Server!
Check out the Nerd Roundup community on Discord - hang out with 81 other members and enjoy free voice and text chat.
![](https://cdn.discordapp.com/icons/696792677278154832/eb3e3a463b22e6dcef750600094fd273.jpg?size=256)
open System
open System.Text
open FSharp.Collections
open System.Numerics
let characterLookup =
[ (0,"0");(1,"1");(2,"2");(3,"3");(4,"4");(5,"5");(6,"6");(7,"7");(8,"8")
;(9,"9");(10,"a");(11,"b");(12,"c");(13,"d");(14,"e");(15,"f") ]
// (all of these test sections go away when done, only needed during coding, not maintenance or execution)
type NumberBase = BaseInBaseTenNotation of string | BaseAsACustomString of string
// OUTER ONION NOTE TRIES
let srcNumberToTranslate=try Environment.GetCommandLineArgs()[2] with |_ ->BaseInBaseTenNotation "0"
let srcNumberBase=try Environment.GetCommandLineArgs()[3] with |_ -> BaseInBaseTenNotation "10"
let targetNumberBase=try Environment.GetCommandLineArgs()[4] with |_ -> BaseInBaseTenNotation"10"
// OUTER ONION TEST
![](https://cdn.danielbmarkham.com/2023/01/Daniel-Signature.png)
Comments ()