I'm not sure this is strictly necessary, but I think it's a good idea to explicitly use the "C*" types when doing formatting with varargs, to make sure the calling convention matches what the callee expects:
String(format: "%llx", CLongLong(myNumber)) On Wed, May 25, 2016 at 1:19 PM, Jens Alfke via swift-users < swift-users@swift.org> wrote: > > On May 25, 2016, at 12:10 PM, Ken Burgett <k...@iotone.io> wrote: > > You are correct, the "%llx" works for UInt64, while "%16x" does not. > "%llX" also works, producing an uppercase string. > Should this be reported as a bug? > > > No, it’s correct behavior. You need to use the “ll” ("long long") modifier > to specify that the parameter is a 64-bit value. > > —Jens > > _______________________________________________ > swift-users mailing list > swift-users@swift.org > https://lists.swift.org/mailman/listinfo/swift-users > >
_______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users