/* ** Convert English measurement units ** ** Takes command line arguments in inches and converts to: ** ** 1. feet and inches (expressed as floating point) ** 2. feet and inches (expressed as fraction) ** ** public domain demo by Bob Stout ** uses ROUND.H from SNIPPETS */ #include #include #include #include "round.h" #define BASE 64.0 void cnvrt_inches(double input, double *feet, double *inches, double *dec_inches, double *num_inches, double *den_inches) { double quot, rem, temp; /* ** Split feet and inches */ *feet = floor(input / 12.0); *inches = fmod(input, 12.0); /* ** Get integer inches and fractions */ *num_inches = modf(*inches, dec_inches) * BASE; *num_inches = fround(*num_inches, 0); if (0.0 == *num_inches) return; /* ** Reduce fractions to lowest common denominator */ for (*den_inches = BASE; 0.0 == fmod(*num_inches, 2.0); *den_inches /= 2.0, *num_inches /= 2.0) { ; } } main(int argc, char *argv[]) { double arg, feet, inches, dec, num, den, dummy; while (--argc) { arg = atof(*(++argv)); cnvrt_inches(arg, &feet, &inches, &dec, &num, &den); printf("%f Inches = %d' %.5f\" or %d' %d", arg, (int)feet, inches, (int)feet, (int)dec); if (0.0 == num) puts("\""); else { printf("-%d/%d\"", (int)num, (int)den); if (modf(num, &dummy)) puts(" (approx.)"); else puts(""); } } return EXIT_SUCCESS; } inux/net-next.git/tree/drivers/usb/host/Kconfig?h=nds-private-remove&id=d0e287a401d9acf67b75180b26e2d62b7d482652'>treecommitdiff
diff options
context:
space:
mode:
authorRask Ingemann Lambertsen <rask@formelder.dk>2017-01-21 17:11:43 +0100
committerMark Brown <broonie@kernel.org>2017-01-23 18:10:05 +0000
commitd0e287a401d9acf67b75180b26e2d62b7d482652 (patch)
treef1ba3cd0583e38846c4f6e32eee74a25a2739a31 /drivers/usb/host/Kconfig
parentd00b74613fb18dfd0a5aa99270ee2e72d5c808d7 (diff)
regulator: axp20x: AXP806: Fix dcdcb being set instead of dcdce
A typo or copy-paste bug means that the register access intended for regulator dcdce goes to dcdcb instead. This patch corrects it. Fixes: 2ca342d391e3 (regulator: axp20x: Support AXP806 variant) Signed-off-by: Rask Ingemann Lambertsen <rask@formelder.dk> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/usb/host/Kconfig')