(1) -> x := interval(-2.0,-1.0)$Interval Float
(1) [- 2.0, - 1.0]
Type: Interval(Float)
(2) -> x^(2/1)
(2) [0.0, 4.0000000000_000000001]
Type: Interval(Float)
(3) -> x^2
(3) [0.9999999999_9999999999, 4.0000000000_000000001]
Type: Interval(Float)
Notice that for the fractional power (2/1), the answer is wrong.
- Qian
diff --git a/src/algebra/interval.spad b/src/algebra/interval.spad
index 180b1c7b..8bd84ec1 100644
--- a/src/algebra/interval.spad
+++ b/src/algebra/interval.spad
@@ -429,7 +429,7 @@
error "fractional power only defined for x > 0"
even?(numer(n)) =>
hi < 0 =>
- interval(0, lo^n)
+ interval(hi^n, lo^n)
interval(0, max(lo^n, hi^n))
interval(lo^n, hi^n)
interval(lo^n, hi^n)
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/9f27c2b4-2410-4604-9be2-4c346f0110d8%40gmail.com.