From 62665bb2942152e023cec00387912a2f7b00ed4a Mon Sep 17 00:00:00 2001
From: Chris Lesiak <chris.lesiak@licor.com>
Date: Tue, 22 Mar 2016 10:26:04 -0500
Subject: [PATCH] Fix Errors in Why Homogeneous Systems
The FAQ entry on homogeneous systems asks the reader to consider the
following:
cout << sin(asin(180.0 * degrees));
There are two problems with this:
1. It won't compile because asin does not take an angle.
2. Even with the order of asin and sin swapped, the example is
confusing because it isn't clear if the results should be
180 degrees, or 0 degrees.
Improve the explanation by swapping sin and asin and using 90 degrees.
---
doc/units.qbk | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/units.qbk b/doc/units.qbk
index 618212f..0c7345f 100644
a
|
b
|
radians instead...)
|
1204 | 1204 | |
1205 | 1205 | Consider the following code: |
1206 | 1206 | |
1207 | | cout << sin(asin(180.0 * degrees)); |
| 1207 | cout << asin(sin(90.0 * degrees)); |
1208 | 1208 | |
1209 | 1209 | What should this print? If only heterogeneous |
1210 | | systems are available it would print 3.14159+ rad |
1211 | | Why? Well, `asin` would return a `quantity<dimensionless>` |
| 1210 | systems are available it would print 1.5708 rad |
| 1211 | Why? Well, `sin` would return a `quantity<dimensionless>` |
1212 | 1212 | effectively losing the information that degrees |
1213 | 1213 | are being used. In order to propogate this extra information |
1214 | 1214 | we need homogeneous systems. |