Skip to content

Instantly share code, notes, and snippets.

View michaellindahl's full-sized avatar

Michael Lindahl michaellindahl

View GitHub Profile
@michaellindahl
michaellindahl / NumberFormatterMaxUnit.swift
Created September 7, 2020 02:24
NumberFormatter produces invalid result with numbers close to UInt.max
import Foundation
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
func printStrings(_ int: UInt) {
let formatted = formatter.string(for: int)
print("String interpolation: \(int)")
print("Number Formatter: \(formatted)")

Keybase proof

I hereby claim:

  • I am michaellindahl on github.
  • I am michaellindahl (https://keybase.io/michaellindahl) on keybase.
  • I have a public key ASAGbGHl_guN8aCvza4unw4m7lJQjskBRTWbqj9WRKuB_Qo

To claim this, I am signing this object:

@michaellindahl
michaellindahl / PlaySoundExample.asm
Created December 4, 2013 05:48
MASM Assembly code that uses the Windows PlaySound function to play .wav files
TITLE MASM PlaySound (PlaySoundExample.asm)
; Description: MASM Assembly code that uses the Windows PlaySound function to play .wav files
; Revision date: Created Dec 3, 2013 by Michael Lindahl
includelib Winmm.lib
PlaySound PROTO,
pszSound:PTR BYTE,
hmod:DWORD,