Skip to content

Commit 6c48505

Browse files
committed
Squashed commit of the following:
commit 1c0522f Merge: 4c239d5 ee93bd4 Author: Benoît Richard <kolaru@hotmail.com> Date: Sun Jul 23 23:13:48 2023 +0200 Merge pull request #569 from vaerksted/master fix typos commit ee93bd4 Author: spaette <spaette@gmx.com> Date: Sat Jul 22 12:11:01 2023 -0500 typos commit 4c239d5 Author: Benoît Richard <kolaru@hotmail.com> Date: Tue Jul 4 00:35:20 2023 +0200 Bump version commit 249040d Merge: 4404658 7bef23e Author: Benoît Richard <kolaru@hotmail.com> Date: Tue Jul 4 00:34:13 2023 +0200 Merge pull request #525 from petvana/simplified-mod Simplified version of mod(x::Interval, y::Real) commit 4404658 Author: Benoît Richard <kolaru@hotmail.com> Date: Wed Jun 14 14:03:14 2023 +0200 Bump version for release commit 7bef23e Author: Petr Vana <petvana@centrum.cz> Date: Fri May 27 11:11:53 2022 +0200 Cleanup commit f9f4733 Author: Petr Vana <petvana@centrum.cz> Date: Fri May 27 11:10:05 2022 +0200 Throw ArgumentError for Interval divisor for mod commit 6fdc809 Merge: 439723f d2603d6 Author: Petr Vana <petvana@centrum.cz> Date: Fri May 27 11:01:43 2022 +0200 Merge branch 'simplified-mod' of github.com:petvana/IntervalArithmetic.jl into simplified-mod commit 439723f Author: Petr Vana <petvana@centrum.cz> Date: Fri May 27 11:01:27 2022 +0200 Disable divisor for mod to be an interval commit d2603d6 Author: Petr Vana <vanapet1@fel.cvut.cz> Date: Thu May 26 11:34:04 2022 +0200 Update docs commit 45abc46 Author: Petr Vana <vanapet1@fel.cvut.cz> Date: Thu May 26 11:30:14 2022 +0200 Implementation for strictly negative divisors for mod commit ff47910 Author: Petr Vana <vanapet1@fel.cvut.cz> Date: Thu May 26 11:11:35 2022 +0200 Add todo for mod with between two intervals commit ea00b23 Author: Petr Vana <petvana@centrum.cz> Date: Wed May 25 19:59:30 2022 +0200 Imrpove test coverage + use zero() commit b56f4be Author: Petr Vana <vanapet1@fel.cvut.cz> Date: Wed May 25 13:44:24 2022 +0200 Use ⊇ operator commit d23df89 Author: Petr Vana <petvana@centrum.cz> Date: Tue May 24 21:13:53 2022 +0200 Update src/intervals/functions.jl Co-authored-by: lucaferranti <49938764+lucaferranti@users.noreply.github.com> commit 153d749 Author: Petr Vana <petvana@centrum.cz> Date: Tue May 24 20:27:51 2022 +0200 Improve testing commit fea1b34 Author: Petr Vana <petvana@centrum.cz> Date: Tue May 24 20:10:05 2022 +0200 Introduce simplified version of mod
1 parent 91dede5 commit 6c48505

File tree

5 files changed

+47
-6
lines changed

5 files changed

+47
-6
lines changed

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- The package now supports only Julia v1.3 and later.
77

88
### Breaking changes
9-
- Changed from using `FastRounding.jl` to `RoundingEmulator.jl` for the defalt rounding mode. [#370](https://github.com/JuliaIntervals/IntervalArithmetic.jl/pull/370)
9+
- Changed from using `FastRounding.jl` to `RoundingEmulator.jl` for the default rounding mode. [#370](https://github.com/JuliaIntervals/IntervalArithmetic.jl/pull/370)
1010

1111

1212
## v0.15
@@ -293,7 +293,7 @@ v0.1 is the first public release of the package.
293293

294294
### Interval arithmetic
295295
- Two methods for interval rounding are available:
296-
(i) narrow/slow (which uses hardward rounding mode changes for `Float64` intervals, and (ii) wide/fast (which does not change the rounding mode)
296+
(i) narrow/slow (which uses hardware rounding mode changes for `Float64` intervals, and (ii) wide/fast (which does not change the rounding mode)
297297
- The current interval precision and rounding mode are stored in the `parameters` object
298298
- The macro `@interval` generates intervals based on the current interval precision
299299
- Trigonometric functions are "nearly" rigorous (for `Float64` intervals, correct rounding is not currently guaranteed)

docs/src/input_output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
'u' Returns the interval with midpoint as lower bound and radius taken in upward direction.
7474
'C' Returns upper case for Empty, Entire and Nai
7575
'c' Returns lower case for Empty, Entire and Nai
76-
'+' Returns postitve numbers with '+' sign before the number
76+
'+' Returns positive numbers with '+' sign before the number
7777
'0' Left-pads the numbers with zeros instead of spaces within the field width
7878

7979
- The field width specifies the length of midpoint string.

examples/Range of 2-dimensional functions.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356
"\t\tconsole.log.apply(console, arguments);\n",
357357
"\t }\n",
358358
"\t},\n",
359-
"\t// a central way to initalize communication\n",
359+
"\t// a central way to initialize communication\n",
360360
"\t// for widgets.\n",
361361
"\tcommInitializer: function (widget) {\n",
362362
"\t widget.sendUpdate = function () {};\n",
@@ -435,7 +435,7 @@
435435
" });\n",
436436
"\t });\n",
437437
"\n",
438-
"\t // coordingate with Comm and redraw Signals\n",
438+
"\t // coordinate with Comm and redraw Signals\n",
439439
"\t // XXX: Test using Reactive here to improve performance\n",
440440
"\t $([IPython.events]).on(\n",
441441
"\t\t'output_appended.OutputArea', function (event, type, value, md, toinsert) {\n",

src/multidim/intervalbox.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ length(::IntervalBox{N}) where {N} = N
6161
6262
Return a vector of the `mid` of each interval composing the `IntervalBox`.
6363
64-
See `mid(X::Interval, α=0.5)` for more informations.
64+
See `mid(X::Interval, α=0.5)` for more information.
6565
"""
6666
mid(X::IntervalBox) = mid.(X)
6767
scaled_mid(X::IntervalBox, α) = scaled_mid.(X, α)

test/interval_tests/numeric.jl

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,44 @@ end
386386
@test nthroot(interval(BigFloat, -81, -16), -4)
387387
@test nthroot(interval(BigFloat, -81, -16), 1) interval(BigFloat, -81, -16)
388388
end
389+
390+
# approximation used for testing (not to rely on ≈ for intervals)
391+
# ⪆(x, y) = (x ≈ y) && (x ⊇ y)
392+
(x::Interval, y::Interval) = x.lo y.lo && x.hi y.hi && x y
393+
394+
@testset "`mod`" begin
395+
r = 0.0625
396+
x = r..(1+r)
397+
@test mod(x, 1) == mod(x, 1.0) == 0..1
398+
@test mod(x, 2) == mod(x, 2.0) x
399+
@test mod(x, 2.5) x
400+
@test mod(x, 0.5) == 0..0.5
401+
@test mod(x, -1) == mod(x, -1.0) == -1..0
402+
@test mod(x, -2) == mod(x, -2.0) -2+x
403+
@test mod(x, -2.5) -2.5+x
404+
@test mod(x, -0.5) == -0.5..0
405+
406+
x = (-1+r) .. -r
407+
@test mod(x, 1) == mod(x, 1.0) 1+x
408+
@test mod(x, 2) == mod(x, 2.0) 2+x
409+
@test mod(x, 2.5) 2.5+x
410+
@test mod(x, 0.5) == 0..0.5
411+
@test mod(x, -1) == mod(x, -1.0) x
412+
@test mod(x, -2) == mod(x, -2.0) x
413+
@test mod(x, -2.5) x
414+
@test mod(x, -0.5) == -0.5..0
415+
416+
x = -r .. 1-r
417+
@test mod(x, 1) == mod(x, 1.0) == 0..1
418+
@test mod(x, 2) == mod(x, 2.0) == 0..2
419+
@test mod(x, 2.5) == 0..2.5
420+
@test mod(x, 0.5) == 0..0.5
421+
@test mod(x, -1) == mod(x, -1.0) == -1..0
422+
@test mod(x, -2) == mod(x, -2.0) == -2..0
423+
@test mod(x, -2.5) == -2.5..0
424+
@test mod(x, -0.5) == -0.5..0
425+
426+
# TODO - implement mod for two intervals
427+
@test_throws ArgumentError mod(1..2, 1.4..1.5)
428+
@test_throws ArgumentError mod(1.0, 1.4..1.5)
429+
end

0 commit comments

Comments
 (0)