r8_wrap_test <- function ( ) #*****************************************************************************80 # ## r8_wrap_test() tests r8_wrap(). # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 14 September 2026 # # Author: # # John Burkardt # { source ( "/home/john/public_html/r_src/r8lib/r8_wrap.R" ) a = - 2.0 b = 12.0 rhi = 6.5 rlo = 3.0 test_num = 20 cat ( '\n' ) cat ( 'r8_wrap_test():\n' ) cat ( ' r8_wrap() "wraps" an R8 to lie within an interval:\n' ) cat ( '\n' ) cat ( ' Wrapping interval is ', rlo, ', ', rhi, '\n' ) cat ( '\n' ) cat ( ' R R8_WRAP ( R )\n' ) cat ( '\n' ) for ( test in 1 : test_num ) { r = a + ( b - a ) * runif ( 1 ) r2 = r8_wrap ( r, rlo, rhi ) cat ( ' ', r, ' ', r2, '\n' ) } }